
RampUpDownPlugin : AbstractControlPlugin{ 
	
	var dir = 1, value = 0;
	
	
	getSpecs{
		^Dictionary[
			\timeUp -> ControlSpec.new( minval:1, maxval:200, step:1, warp:'exponential'),	
			\timeDown -> ControlSpec.new( minval:1, maxval:200, step:1, warp:'exponential'),	
			\intensity -> ControlSpec.new( minval:0, maxval:1, step:0.01),	
			\paused -> ControlSpec.new( minval:0, maxval:1, step:1)
		]
	}
	
	
	
	onReset{
		value = 1;
	}
	
	populateVals{
		vals.put(\timeUp, 10);
		vals.put(\timeDown, 10);
		vals.put(\intensity, 0);
		vals.put(\paused, 0);
	}
	
	process{| ctrlVal |	

		if(	vals.at(\paused) == 0,
			{
		
				if(
					dir == -1,
					{value = value - (1 / vals.at(\timeDown) )},
					{value = value + (1 / vals.at(\timeUp) )}
				);
			}
		);
		
		value = value.max(0).min(1);
		
		if(
			value == 0,
			{dir = 1}	
		);
		
		if(
			value == 1,
			{dir = -1};	
		);
		
		^ ctrlVal * (1 - (value * vals.at(\intensity)) );
	}
}

RampUpPlugin : AbstractControlPlugin{
	
	var dir = -1, value = 1;
	
	onReset{
		"reseting".postln;
		value = 1;
	}
	
	populateVals{
		vals.put(\timeDown, 10);
		vals.put(\intensity, 0);
		vals.put(\paused, 0);
	}
	
	process{| ctrlVal |	
	

		if(	vals.at(\paused) == 0,
			{
		
				if(
					dir == -1,
					{value = value - (1 / vals.at(\timeDown) )},
					{}
				);
			}
		);
		
		value = value.max(0).min(1);
		
		if(
			value == 0,
			{dir = 1}	
		);
		
		if(
			value == 1,
			{dir = -1};	
		);
		
		^ ctrlVal * (1 - (value * vals.at(\intensity)) );
	}

}